
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="renderer" content="webkit">
  <title>enianMenu演示</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="layui/css/layui.css"  media="all">
</head>
<style type="text/css">
	body{margin:10px;}
</style>
<body>  
<a  class="layui-btn" href="http://enianteam.com/doc/layui_module/43.html" style="margin: 20px;">点击查看详细文档和参数解释</a>

<div id="menu"></div>

<div class="layui-btn-group" style="margin: 10px;">
  <button id='btn1' class="layui-btn">选中标题为  应用管理 </button>
  <button id='btn2' class="layui-btn">选中标题为  可点击分组 </button>
  <button id='btn3' class="layui-btn">选中url值为 /adminlist.html</button>
</div>

<script src="layui/layui.js"></script>
<script type="text/javascript">
	
	layui.config({base: 'module/'})//根据自己的情况引入模块
	layui.use(['enianMenu','layer','jquery'],function(){
		var menu = layui.enianMenu,layer = layui.layer,$=layui.jquery;
		var data = [{"id":28,"title":"主页","img":"","type":"0","aid":1,"url":"/admin/index/applist.html","pid":"20"}
 ,{"id":27,"title":"管理员列表","img":"","type":"0","note":'我是管理员列表',"aid":1,"url":"/adminlist.html","pid":"25"}
 ,{"id":26,"title":"应用管理","img":"","type":"0","aid":1,"url":"/admin/index/applist.html","pid":"25"}
 ,{"id":20,"title":"首页","img":"","type":null,"note":'我是首页',"aid":1,"pid":"0","open":true}
 ,{"id":25,"title":"分组2","img":"","type":null,"aid":1,"pid":"0"}
 ,{"id":21,"title":"可点击分组","img":"","note":'我是可点击分组',"type":null,"aid":1,"url":"/admin/666.html","pid":"0"}];
 
 		menu.render(data,'#menu',function(obj){
		   var url = obj.url;
		   layer.alert(JSON.stringify(obj))
		   console.log(obj)
		})
 		$('#btn1').click(function(){
 			menu.setCheck('title','应用管理');
 		})
 		$('#btn2').click(function(){
 			menu.setCheck('title','可点击分组');
 		})
 		$('#btn3').click(function(){
 			menu.setCheck('url','/adminlist.html');
 		})
	})
</script>
</body>
</html>